import service from '@/utils/request'
/**
 * 获取月卡列表
 * @param {*} params 参数
 * @returns
 */
export function getCardListAPI (params) {
  return service({
    url: '/parking/card/list',
    params
  })
}

/**
 * 添加月卡
 * @param {*} data
 * @returns
 */
export function addCardAPI (data) {
  return service({
    url: '/parking/card',
    method: 'POST',
    data
  })
}

/**
 * 获取编辑页月卡详情
 * @param {*} id
 * @returns
 */
export function cardDetailAPI (id) {
  return service({
    url: `/parking/card/detail/${id}`
  })
}

/**
 * 编辑月卡
 * @param {*} data
 * @returns
 */
export function editCardAPI (data) {
  return service({
    url: '/parking/card/edit',
    method: 'put',
    data
  })
}

/**
 * 删除月卡
 * @param {*} id
 * @returns
 */
export function deleteCardAPI (id) {
  return service({
    url: `/parking/card/${id}`,
    method: 'DELETE'
  })
}
